1 using System;
2 using
System.Collections.Generic;
3 using
System.ComponentModel;
4 using
System.Data;
5 using
System.Drawing;
6 using
System.Linq;
7 using
System.Text;
8 using
System.Threading.Tasks;
9 using
System.Windows.Forms;
10
11 namespace
SoftQuanLyNhaHang.Views
12 {
13     
public partial class frmDangNhap : Form
14     {
15         
public frmDangNhap()
16         {
17             InitializeComponent();
18         }
19
20         
private void frmDangNhap_Load(object sender, EventArgs e)
21         {
22
23         }
24
25         
private void btnOk_Click(object sender, EventArgs e)
26         {
27             
if (txtTenDangNhap.Text == "")
28             {
29                 MessageBox.Show(
"Hãy nhập vào tên đăng nhập");
30             }
31             
else
32             {
33                 
if (txtMatKhau.Text == "")
34                     MessageBox.Show(
"Hãy nhập vào mật khẩu");
35             }
36
37             
string check = "";
38             
string user = txtTenDangNhap.Text;
39             
string pass = Models.UserControl.SHA256(txtMatKhau.Text);
40             check = Controllers.DangNhap.CheckDangNhap(user, pass);
41             
if (check == "")
42             {
43                 MessageBox.Show(
"Tên đăng nhập hoặc mật khẩu không đúng");
44
45             }
46             
else
47             {
48
49                 frmMain frm =
new frmMain();
50                 
this.Hide();
51                 frm.ShowDialog();
52                 
this.Close();
53             }
54         }
55     }
56 }


Gõ tìm kiếm nhanh...